﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Micro.Modules.Abstractions
{
    /// <summary>
    /// 模块集合
    /// </summary>
    public interface IModuleCollection : IList<IModule>
    {

        IModule GetById(string id);

        IModule GetByCode(string code);
        /// <summary>
        /// 读取所有模块
        /// </summary>
        Task Load();

        Task<(bool IsSuccess, IModule ModuleInfo, string Error)> AddModule(string path);

        Task<(bool IsSuccess, IModule ModuleInfo, string Error)> AddModule(DirectoryInfo moduleDir);
    }
}
